using Services.Initial.PublicProject.PublicClass.ExtensionException;
using Zack.DomainCommons.Models;
namespace Services.Activity.Domain.Entities;
public class ActivityReviews:ISoftDelete
{
    public long ReviewId { get; private set; }
    public long ActivityId { get; private set; }
    public string? ReviewContent { get; private set; }
    //一条评论最多包含一张图片
    public string? PhotoBase64 { get; private set; }
    public DateTime CreateTime { get; private set; }
    public bool IsDeleted { get; private set; }
    private ActivityReviews() { }
    public void SoftDelete()
    {
        this.IsDeleted = true;
    }
    public static ActivityReviews Create(string reviewContent, long activityId,string photoPath)
    {
        if (string.IsNullOrWhiteSpace(reviewContent))
        {
            throw new ExceptionWithStatus(System.Net.HttpStatusCode.BadRequest, "评论不能为空");
        }
        var review = new ActivityReviews
        {
            ActivityId = activityId,
            ReviewContent = reviewContent,
            CreateTime = DateTime.Now,
            PhotoBase64 = photoPath
        };
        return review;
    }

}